import 'package:flutter/widgets.dart';
import 'package:osc/res/colors.dart';
import 'package:osc/res/dimens.dart';
import 'package:osc/utils/pd_util.dart';

class NoDataWidget extends StatelessWidget {
  final String text;
  final String imageName;

  NoDataWidget({this.text = "没有数据", this.imageName = "ic_tip_fail"});

  @override
  Widget build(BuildContext context) {
    return new Container(
      color: Colours.bg_page,
      child: Column(
        children: <Widget>[
          Padding(
            padding: EdgeInsets.all(Dimens.gap_activity_vertical),
            child: Image.asset(
              PdUtil.getImagePath(imageName),
              width: 120,
              height: 120,
            ),
          ),
          Padding(
            padding: EdgeInsets.only(top: Dimens.gap_view_normal),
            child: Text(
              text,
              style:
                  TextStyle(color: Colours.gray_66, fontSize: Dimens.font_sp12),
            ),
          ),
        ],
      ),
    );
  }
}
